import { utilJs } from "@/utils/common.js";
export const reportLog = (data = {}) => {
  if (!window.aegisClient) {
    return;
  }
  let userId = localStorage.getItem('userId') == '' ? -100 : localStorage.getItem('userId');
  let companyId = localStorage.getItem('companyId');
  let chl = utilJs.isIOSAppALL() ? 'ios' : utilJs.isAndroidApp() ? 'droid' : (!!utilJs.getMobileBrowserType() && utilJs.getMobileBrowserType() != 'wx' ? utilJs.getMobileBrowserType() : 'gxh'); //chl 为端名：公众号 gxh，小程序 xcx，ios，安卓 droid, pcwb  新增：抖音=dy, 快手=ks，普通浏览器=llq
  let defaultData = {
    level:2,
    userId,
    companyId,
    chl,
  }
  data = {...defaultData, ...data};

  window.aegisClient.report({
    msg: JSON.stringify(data),
    level: data.level,
    ext1: userId,
  })
}